<template>
    <div class="box">
        <header class="header">
          <ul>
            <li @click="back"><i class="iconfont icon-jiantouarrowhead7"></i></li>
            <li><h5>购物车</h5></li>
            <li><p>编辑</p></li>
          </ul>
        </header>
        <div class="content">
          <div class="carts">
            <ul>
              <li>
                <dl>
                  <dt>
                    <p @click="buy"><i class="iconfont icon-duihao3" v-show="show"></i></p>
                    <img src="@/../static/03.jpg" alt="">
                  </dt>
                  <dd>
                    <h4>6层纯棉纱布浴巾、盖毯、包巾</h4>
                    <h5>A类品质，无荧光，无甲醛</h5>
                    <span>尺码：100*99cm</span><span>颜色：蓝色</span>
                    <p>￥119.8</p>
                    <b>×2</b>
                  </dd>
                </dl>
              </li>
              <li>
                <dl>
                  <dt>
                    <p @click="buy"><i class="iconfont icon-duihao3" v-show="show"></i></p>
                    <img src="@/../static/03.jpg" alt="">
                  </dt>
                  <dd>
                    <h4>6层纯棉纱布浴巾、盖毯、包巾</h4>
                    <h5>A类品质，无荧光，无甲醛</h5>
                    <span>尺码：100*99cm</span><span>颜色：蓝色</span>
                    <p>￥119.8</p>
                    <b>×2</b>
                  </dd>
                </dl>
              </li>
            </ul>
            <div class="total">
              <ul>
                <li><p class="quanxuan" @click="buy"><i class="iconfont icon-duihao3" v-show="show"></i></p><b>全选</b></li>
                <li></li>
                <li><p>合计：￥</p></li>
                <li>结算（0）</li>
              </ul>
            </div>
          </div>
        </div>
    </div>
</template>

<script>
export default {
  methods: {
    back () {
      this.$router.go(-1)
    },
    buy () {
      this.show=!this.show
    }
  },
  data () {
    return {
      show:false
    }
  }
}
</script>

<style lang="scss" scoped>
@import '@/lib/reset.scss';
.header {
  @include rect(100%, 0.4rem);
  @include background-color(#DFDFDF);
  ul {
    @include rect (95%, 100%);
    // background:red;
    margin:0 auto;
    @include flexbox();
    @include justify-content(space-between);
    @include align-items();
    li {
      i{
        @include font-size(0.15rem);
        @include text-color(#101010);
      }
      h5 {
        @include font-size(0.15rem);
        @include text-color(#101010);
        @include font-weight(100);
      }
    }
  }
}
.carts {
  ul {
    li {
      @include rect(100%, 1.43rem);
      dl {
        @include rect(100%, 100%);
        @include flexbox();
        @include justify-content();
        dt {
          @include rect(35%, 100%);
          @include flexbox();
          @include justify-content();
          @include align-items();
          // background:red;
          p {
            @include rect(0.2rem, 0.2rem);
            border:1px solid #ccc;
            margin-right:0.05rem;
            border-radius: 50%;
            line-height: 0.2rem;
            text-align: center;
          }
          img {
            @include rect(1rem, 1rem);
          }
        }
        dd {
          @include rect(65%, 100%);
          // background:blue;
          padding:0.2rem 0.1rem;
          h4 {
            @include rect(100%, 0.3rem);
            line-height: 0.3rem;
            color:#888;
            font-size: 0.14rem;
          }
          h5 {
            @include rect(100%, 0.2rem);
            line-height: 0.2rem;
            color:#d9d9d9;
            font-size: 0.12rem;
          }
          span {
            @include rect(100%, 0.2rem);
            line-height: 0.2rem;
            color:#d2d2d2;
            font-size: 0.1rem;
          }
          p {
            @include rect(50%, 0.2rem);
            line-height: 0.2rem;
            color:#d2d2d2;
            font-size: 0.1rem;
          }
          b {
            @include rect(10%, 0.2rem);
            line-height: 0.2rem;
            color:#d2d2d2;
            font-size: 0.1rem;float:right;
          }
        }
      }
    }
  }
  .total {
    @include rect(100%, 0.5rem);
    background:#eee;
    position: fixed;
    bottom:0;
    ul {
      @include rect(100%, 100%);
      @include flexbox();
      @include justify-content(space-between);
      @include align-items();
      position: relative;
      top:0;
      li {
        height:100%;
        @include flexbox();
        @include align-items();
        @include justify-content();
        .quanxuan {
            @include rect(0.2rem, 0.2rem);
            border:1px solid #ccc;
            margin-right:0.05rem;
            border-radius: 50%;
            line-height: 0.2rem;
            text-align: center;
          }
      }
    }
  }
}
</style>
